<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .container{
            width: 500px;
            border: 1px solid red;
            margin: 100px auto;
            position: relative;
            overflow: hidden;
        }
        .all{
            width: 2000px;
        }
        .all::after{
            content: "";
            display: block;
            height: 0;
            clear: both;
        }
        img{
            width: 500px;
            display: block;
            float: left;
        }
        a{
            text-decoration: none;
            display: block;
            width: 30px;
            height: 30px;
            position: absolute;
            background-color: #000;
            opacity: 0.5;
            top:50%;
            margin-top:-15px;
            border-radius: 50%;
            line-height: 30px;
            font-size: 28px;
            color: #fff;
            padding:15px;
            
        }
        #prev{
            left: -25px;
            text-align: right;
        }
        #next{
            right: -25px;
            text-align: left;
        }
    </style>
</head>
<body>
    




    <div class="container">
        <div class="all">
            <img index="1" src="images/1.jpg" >
            <img index="2" src="images/2.jpg" >
            <img index="3" src="images/3.jpg" >
            <img index="4" src="images/4.jpg" >
        </div>
        <a id="prev" href="javascript:;">&lt;</a>
        <a id="next" href="javascript:;">&gt;</a>
    </div>

    <script>
        document.getElementById("prev").onclick = function(){
            
        }
    </script>
</body>
</html>